﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace CAOS.Web.Controllers
{
    public class BusinessController : BaseController
    {
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.Initialize(requestContext);

            if (Configuracao == null || Configuracao.Sistema == null || Configuracao.UsuarioLogado == null)
            {
                FormsAuthentication.SignOut();
                RedirectToAction("Login", "Login");
                return;
            }

            ViewBag.SiglaSistema = Configuracao.Sistema.Sigla;
            ViewBag.SistemaID = Configuracao.Sistema.SistemaID;
            ViewBag.LoginUsuario = Configuracao.UsuarioLogado.Login;
            ViewBag.AdministrandoCAOS = Configuracao.AdministrandoCAOS;
        }
    }
}
